1. Field of the Invention
This invention generally relates to remote unit time synchronization and, more particularly, to a system and method for improving time calculations under transient time adjustment conditions in devices with variable delays in the pre and post time measurement points.
2. Description of the Related Art
Many network-connected systems include a local device that needs to acquire an accurate time from a remote device, and keep a local copy that is synchronized to the remote device time. Since the connection to the remote device is over a network, and a reading of the remote device's time can only be made from time-to-time instead of continuously, the local device may need to update its local time every time a new time measurement is received from the remote device. Typically, the measurement is received over a network that has a transit time from when the remote device makes the measurement, to when the local device receives the measurement. Thus, a means for determining this transit time is necessary. Usually, this determination is made by having the local device send back a message with the original time measurement, including the amount of time that the message resided within the local device, which is referred to herein as the residence time.
A residence time calculation requires that the local device subtract the time at which a message is received, from the time at which the message is sent. However, if an adjustment is made to the local device clock in time between the time when the message arrived and when the message is sent, then this adjustment creates an error in the measured residence time. That is, the local time reference for the arrival time becomes different than the local time reference for the message departure time, and this change in the local time reference creates an error.
In order to prevent this error, two things can be done. First, make no adjustments to the local time while a message requiring a residence time calculation is pending in the local device. Alternatively, recognize that an adjustment was made and provide a means to compensate for that adjustment. Not making the time adjustment (option 1) delays the local device time adjustments, resulting in less accurate residence time transit time reporting. Option 2 requires that the local device control and keep track of how many outstanding residence time calculations there are at any given time, which adds complication to measurement algorithm.
It would be advantageous if simple, yet accurate residence time calculations could be made for pending messages that takes into account local time adjustments.